package com.yj.consumer.config;

import feign.*;
import feign.codec.ErrorDecoder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * feign配置类
 * 配置loggerLevel、errorDecoder、retryer等
 * 配置类加@Configuration就是全局配置，
 * 不加@Configuration可以在各个@FeignClient的configuration属性中指定
 */
//@Configuration
public class CommonFeignConfig {
    @Bean
    public Logger.Level getFeignLoggerLevel() {
        return Logger.Level.FULL;
    }
    @Bean
    ErrorDecoder getErrorDecoder() {
        return new MyErrorDecoder();
    }
    @Bean
    Retryer getRetryBean() {
        return new MyRetryer();
    }
}

